package com.wyy.ems_vue.dao;/*
 **
 * @author yangyang
 *@date 2022/07/02 16:27
 **/

import com.wyy.ems_vue.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserDao {
    @Insert("insert into t_user values (#{id},#{username},#{realname},#{password},#{sex},#{status},#{registerTime})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void save(User user);

    @Select("select id,username,realname,password,sex,status,regsterTime from t_user where username=#{username}")
    User findByUserName(String username);

}
